const memoize = fn => {
    let cache = false
    let result = undefined
    return () => {
        if(cache){
            return result;
        }else{
            result = fn()
            cache = true
            fn = undefined
            return result
        }
    }
}

module.exports = memoize;